Skip to content

Move setState callback to right after didUpdate#8204

Merged
sophiebits merged 1 commit intofacebook:masterfrom
sophiebits:setState-cb
Nov 5, 2016
Merged

Move setState callback to right after didUpdate#8204
sophiebits merged 1 commit intofacebook:masterfrom
sophiebits:setState-cb

Conversation

@sophiebits
Copy link
Copy Markdown
Collaborator

It's much easier to do it this way in Fiber and there shouldn't be much observable difference.

It's much easier to do it this way in Fiber and there shouldn't be much observable difference.
@acdlite
Copy link
Copy Markdown
Collaborator

acdlite commented Nov 4, 2016

Not sure how related this is, but there's also a bug in stack where setState callbacks enqueued inside componentWillMount aren't flushed properly: https://github.com/facebook/react/blob/master/src/renderers/shared/stack/reconciler/__tests__/ReactCompositeComponentState-test.js#L174-L207

Should that be dealt with separately?

@sophiebits
Copy link
Copy Markdown
Collaborator Author

I'll fix that now but in a separate PR.

@acdlite
Copy link
Copy Markdown
Collaborator

acdlite commented Nov 4, 2016

LGTM but someone who knows stack should give final approval

@jimbolla
Copy link
Copy Markdown

jimbolla commented Nov 9, 2016

Is there any chance this change makes it into a React 15.x release? This actually fixes an issue in the next version of react-redux? Would be great to have this sooner than React 16.

@gaearon
Copy link
Copy Markdown
Collaborator

gaearon commented Nov 9, 2016

Since it's a potentially breaking change, it can only land in a major version.

acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
It's much easier to do it this way in Fiber and there shouldn't be much observable difference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants